//
//  NSView+MYBgColor.m
//  ModelParser
//
//  Created by JackAndney on 2018/1/2.
//  Copyright © 2018年 Andney. All rights reserved.
//

#import "NSView+MYBgColor.h"

@implementation NSView (MYBgColor)

- (NSColor *)backgroundColor {
    if (self.layer.backgroundColor) {
        return [NSColor colorWithCGColor:self.layer.backgroundColor];
    }else {
        return [NSColor darkGrayColor];
    }
}


- (void)setBackgroundColor:(NSColor *)backgroundColor {
    [self setWantsLayer:YES];
    self.layer.backgroundColor = backgroundColor.CGColor;
}


@end
